<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">创建新的分组</h3>
  </div>
  <div class="modal-body">
  	<form class="form-inline" style="margin-left:80px;">
    		<div class="controls">
     			<label class="control-label" for="inputEmail">分组名称:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" class="input-xlarge" id="groupname" placeholder="分组名称">
    		</div><br>
    		
    		<div class="controls">
     			<label class="control-label" for="inputEmail">组创建人:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" class="input-xlarge" id="creator" placeholder="创建人姓名">
    		</div><br>
    		
		    <div class="controls">
		        <label class="control-label" for="inputPassword">浏览密码:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" id="inputPassword" class="input-xlarge" placeholder="只有输入密码，才能浏览本分组的信息">
		    </div><br>
		    
		    <div class="controls">
		        <label class="control-label" for="inputPassword">重复密码:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" id="reinputRePassword" class="input-xlarge" placeholder="请再输入一次">
		    </div><br>
		    
		    <div class="controls">
		        <label class="control-label" for="inputPassword">联系电话:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="initel" class="input-xlarge" placeholder="电话">
		    </div><br>
		    
		    <div class="controls">
		        <label class="control-label" for="inputPassword">常用qq号:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="iniqq" class="input-xlarge" placeholder="qq">
		    </div><br>
		    
		     <div class="controls">
		        <label class="control-label" for="inputPassword">常用邮箱:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="iniemail" class="input-xlarge" placeholder="常用邮箱">
		    </div><br>
		    
		    <div class="controls">
		        <label class="control-label" for="inputPassword">其他备注:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="iniother" class="input-xlarge" placeholder="其他备注">
		    </div>
	</form>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
    <button class="btn btn-primary" id="create">创建</button>
  </div>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$("#create").click(function(){
			var groupName = $("#groupname").val();
			var creator = $("#creator").val();
			var inputPassword = $("#inputPassword").val();
			var inputRePassword = $("#inputRePassword").val();
			var tel = $("#initel").val();
			var qq = $("#iniqq").val();
			var email = $("#iniemail").val();
			var other = $("#iniother").val();
			
			$.ajax({
				type:'post',
				url:'/addgroup',
				data:'groupName='+groupName+'&creator='+creator+'&inputPassword='+inputPassword+'&tel='+tel+'&qq='+qq+'&email='+email+'&other='+other,
				dataType:'text',
				success:function(msg){
					location.href="/index";
				},
				error:function(){
					alert('failed');
				}
			});
		});
	});
</script>
  </body>
  </html>